-
Notifications
You must be signed in to change notification settings - Fork 607
Clusters Feature Integration #2816
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…user is searching for a cluster name vs a evm address
tive chain count
s.isEnabled to top of the function and utilizes select function of useQuery in useAp iQuery
…date imports and test
…n addressMetadataSchema sub-schema
…while keeping search optimization
… and updates vie wport to narrow test case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some minor comments left, mainly regarding files clean up.
ui/pages/Clusters.pw.tsx
Outdated
test.use({ viewport: devices['iPhone 13 Pro'].viewport }); | ||
|
||
test('clusters directory with data @mobile', async({ render, mockApiResponse, mockAssetResponse }) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe you missed the "+" sign here, so the screenshot for the "mobile" project was not generated. I apologize if the usage of tags like "+@mobile" or "+@dark-mode" is unclear in our contribution guide. I will add some amendments to clarify this later.
Since the component has different views for desktop and mobile devices, let's remove the viewport setting and correct the tag name so that the screenshot will be generated for each device type.
I also noticed that there are some previously generated screenshots for this test suite stored in the repository. Could you please clean them up?
Clusters.pw.tsx_mobile_Clusters-Directory-Page-clusters-directory-empty-state-mobile-1.png
Clusters.pw.tsx_mobile_Clusters-Directory-Page-clusters-directory-with-data-mobile-1.png
Clusters.pw.tsx_mobile_Clusters-Directory-Page-loading-state-mobile-1.png
test.use({ viewport: devices['iPhone 13 Pro'].viewport }); | |
test('clusters directory with data @mobile', async({ render, mockApiResponse, mockAssetResponse }) => { | |
test('clusters directory with data +@mobile', async({ render, mockApiResponse, mockAssetResponse }) => { |
…plicit viewport config, updates screenshots
Description and Related Issue(s)
This PR introduces Clusters Universal Name Service integration into the Blockscout explorer. Clusters is a cross-chain identity service that allows users to track multiple wallets across various networks under a single unified name (like
vitalik/
orfoobar/
).This optional integration adds a new Clusters directory, Clusters leaderboard, individual cluster details page, and search capability. The feature follows established patterns for optional service and includes proper env handling.
Proposed Changes
Environment Variables:
NEXT_PUBLIC_CLUSTERS_API_HOST
- for Clusters API endpointNEXT_PUBLIC_CLUSTERS_CDN_URL
- for Clusters CDN assetsconfigs/envs/.env.jest
andconfigs/envs/.env.localhost
deploy/tools/envs-validator/schema.ts
deploy/values/
Documentation and Configuration:
docs/ENVS.md
jest.config.ts
and added test mocksjest/mocks/
andjest/setupAfterEnv.ts
API Configuration and Types:
clustersApi
configuration inconfigs/app/apis.ts
with optional Clusters API integrationlib/api/services/clusters.ts
for Clusters API service layerconfigs/app/features/clusters.ts
lib/api/resources.ts
andlib/api/types.ts
TypeScript Types and Stubs:
types/api/clusters.ts
stubs/clusters.ts
types/api/search.ts
Core Library and Utilities:
lib/clusters/
directory with utilities for action bar, page utils, and input detectionlib/hooks/
:useAddressClusters.ts
- for address specific cluster datauseClusterPagination.ts
- for cluster pagination logicuseClusterSearch.ts
- for cluster search functionalityuseClustersData.ts
- for main clusters data fetchinguseQueryParams.ts
- for URL query parameter handlinglib/hooks/useNavItems.tsx
lib/metadata/
andlib/mixpanel/
Testing and QA:
lib/clusters/
utilities - action bar, page utils, input detectionuseAddressClusters
,useClusterPagination
,useClusterSearch
,useClustersData
useSearchWithClusters
ClustersEntity
Pages and Routing:
pages/clusters/index.tsx
- main clusters directory pagepages/clusters/[name].tsx
- individual cluster details pageui/pages/Clusters.tsx
- clusters directory page componentui/pages/Cluster.tsx
- individual cluster page componentnextjs/nextjs-routes.d.ts
UI Components:
ui/clusters/
:ClustersActionBar.tsx
- search and filter controlsClustersDirectoryTable.tsx
andClustersDirectoryTableItem.tsx
- directory viewsClustersDirectoryListItem.tsx
- directory list itemClustersLeaderboardTable.tsx
andClustersLeaderboardTableItem.tsx
- leaderboard viewsClustersLeaderboardListItem.tsx
- leaderboard list itemsui/cluster/
:ClusterDetails.tsx
- main cluster detail componentui/address/clusters/
:AddressClusters.tsx
- clusters tab for address pagesui/shared/ClusterIcon.tsx
- cluster icon componentui/shared/entities/clusters/ClustersEntity.tsx
- cluster entity displaySearch and Navigation Integration:
ui/snippets/searchBar/SearchBarSuggest/SearchBarSuggestCluster.tsx
ui/snippets/searchBar/useSearchWithClusters.tsx
ui/shared/search/utils.ts
ui/snippets/navigation/NavLinkIcon.tsx
SearchBar.tsx
,SearchBarInput.tsx
,SearchBarSuggest.tsx
,SearchBarSuggestItem.tsx
Assets and Icons:
icons/clusters.svg
for cluster-specific logo usepublic/icons/name.d.ts
Breaking or Incompatible Changes
None. This is an additive feature that introduces optional clusters functionality. Existing installations will continue to work unchanged, and the new feature can be optionally enabled by setting the NEXT_PUBLIC_CLUSTERS_API_HOST environment variable.
Additional Information
5 minute Loom video displaying the Clusters feature - https://www.loom.com/share/6278c920204249b398a6f227b1cb701d?sid=5b7d6a88-b13e-4002-8fab-0c531ac92090
Checklist for PR author